<admintpl file="header" />
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="javascript:;">本部卡消费明细</a></li>
        <if condition="$user_model == 4 || $user_model == 5 ">
            <li class=""><a href="{:U('AdminFinance/sale_detail_cancel')}">取消的本部卡消费</a></li>
        </if>
    </ul>
    <form class="well form-search" id="form_search" method="post" action="">
        <if condition="$is_manager">
            <if condition="!($user_model == 6)">
                <select name="s_rid" style="margin:0px;">
                    <option value="">请选择卡片所属机构</option>
                    <foreach name="logistics_list" item="litem">
                        <option value="{$litem['id']}" <if condition="$s_rid == $litem['id']">selected</if>>{$litem.logistics_name}</option>
                    </foreach>
                </select>
            </if>
            <select name="s_smid" style="margin:0px;">
                <option value="">请选择消费管理机构</option>
                <foreach name="sale_manager_list" item="sitem">
                    <option value="{$sitem['id']}" <if condition="$s_smid == $sitem['id']">selected</if>>{$sitem.sale_manage_name}</option>
                </foreach>
            </select>
            <select name="s_sid" style="margin:0px;">
                <option value="">请选择消费机构</option>
                <foreach name="sale_list" item="sitem">
                    <option value="{$sitem['id']}" <if condition="$s_sid == $sitem['id']">selected</if>>{$sitem.sale_name}</option>
                </foreach>
            </select>
            </br> </br>
        </if>
        <input type="text" name="s_start_time" id="s_start_time" value="<php> echo date('Y-m-d H:i',$s_start_time);</php>" class="js-datetime" placeholder="开始时间" >
        至
        <input type="text" name="s_end_time" id="s_end_time" value="<php> echo date('Y-m-d H:i',$s_end_time);</php>" class="js-datetime" placeholder="结束时间">
        <input type="text" name="s_card_number" id="s_card_number" value="{$s_card_number}" placeholder="请输入卡号" >
        <input type="submit" class="btn btn-primary" value="搜索" />
        <!--<a class="btn btn-primary" style="float: right;margin-left:15px;margin-bottom:10px;" href="javascript:$('.table-list').jqprint();">打印</a>-->
        <a class="btn btn-primary" style="float: right;" href="javascript:downloadExcel(2);">导出PDF</a>
        <input type="hidden" name="s_download" id="s_download" value="0"/>
        <a class="btn btn-primary" style="float: right;margin-right:15px;margin-bottom:10px;" href="javascript:downloadExcel(1);">导出报表</a>

    </form>
    <form class="js-ajax-form" action="" method="post">
        <table class="table table-hover table-bordered table-list">
        <tr class="show_chlid">
            <th colspan="100" style="text-align: center;">筛选结果汇总</td>
        </tr>
        <tr class="show_chlid">
            <td>汇总单数：{$summary.count}单</td>
            <td>汇总账单总价：{$summary.goods_price}元</td>
            <td>汇总优惠金额：{$summary.dis_price}元</td>
            <td>汇总支付金额：{$summary.price}元</td>
            <td>汇总商品数量：{$summary.goods_num}升</td>
            <td>汇总加油数量：{$summary.oil_num}升</td>
            <td>汇总加气数量：{$summary.not_oil_num}升</td>
        </tr>
        </table>
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th>消费时间</th>
                <th>卡片所属机构</th>
                <th>消费机构</th>
                <th>账单号	</th>
                <th>会员卡号	</th>
                <th>账单类型	</th>
                <th>账单状态	</th>
                <th>支付类型	</th>
                <th>产品单价</th>
                <th>账单总价</th>
                <th>优惠金额</th>
                <th>账单支付金额</th>
                <!-- <th>消费后余额</th> -->
            </tr>
            </thead>
            <foreach name="list" item="vo">
                <tr class="show_chlid">
                    <td><b>
                        <span class="arrow_right"></span>
                        {:date("Y-m-d H:i:s",$vo['create_time'])}</b></td>
                    <td>{$vo.logistics_name}</td>
                    <td>{$vo.sale_name}</td>
                    <td>{$vo.number}</td>
                    <td>{$vo.card_number}</td>
                    <td>一号物流卡消费</td>
                    <td>成功</td>
                    <td>卡帐户转账</td>
                    <td>{$vo.goods_unit_price}</td>
                    <td>{$vo.goods_price}</td>
                    <td>{$vo.dis_price}</td>
                    <td>{$vo.price}</td>
                    <!-- <td>{$vo.plus_price}</td> -->
                </tr>
                <tr class="tr_chlid">
                    <td colspan="13">
                        <ul>
                            <li>一号物流奖励积分：{$vo.general_point}</li>
                            <li>自营奖励积分：{$vo.self_point}</li>
                            <li>剩余积分：{$vo.plus_point}</li>
                            <li>剩余金额：{$vo.plus_price}</li>
                            <li>会员名称：{$vo.vip_name}</li>
                            <li>会员手机号：{$vo.vip_phone}</li>
                            <li>会员车牌号：{$vo.vip_plate_number}</li>
                            <li>销售姓名：{$vo.user_nicename}</li>
                            <li>销售电话：{$vo.user_phone}</li>
                            <li>商品名称：{$vo.goods_name}</li>
                            <li>商品数量：{$vo.goods_num}</li>
                            <li>商品总价：{$vo.goods_price}</li>
                            <li>支付金额：{$vo.price}</li>
                            <li>描述：{$vo.desc}</li>
                            <li><a href="/index.php?g=Sale&m=AdminSale&a=sale_print&id={$vo.id}" style="font-weight: bold;">补打小票</a></li>
                            <if condition="$is_manager">
                                <li><a href="javascript:cancel_post('{$vo.id}','{$vo.card_number}','{$vo.price}');" style="font-weight: bold;">撤销订单</a></li>
                            </if>
                        </ul>
                    </td>
                </tr>
            </foreach>
        </table>

        <div class="pagination">{$page}</div>
    </form>
</div>
<script src="__PUBLIC__/js/common.js?9"></script>
<script src="__PUBLIC__/js/jquery.jqprint-0.3.js"></script>
<script>
    function refersh_window() {
        var refersh_time = getCookie('refersh_time');
        if (refersh_time == 1) {
            window.location = "{:U('AdminFinance/index',$formget)}";
        }
    }
    /*撤销订单*/
    function cancel_post(id, card_number, price) {
        if (confirm('撤销订单后将彻底删除此订单并返还金额 '+price+' 到卡，卡号为：【'+card_number+'】')) {
            var jumpto = '/index.php?g=Sale&m=AdminSale&a=cancel_post&id='+id+'&card_number='+card_number+'&price='+price;
            window.location = jumpto;
        }
    }
</script>
</body>
</html>